package SwordForOffer.Problem10;

public class MyNumberOf1 {
    public int numberOf1(int num) {

        int count = 1;

        while (num != 0){
            num = (num - 1) & num;
            count ++;
        }

        return count;
    }
}
